package leetcode;

/**
 * @program: datastructureandalogorithm
 * @description:
 * @author: hmx
 * @create: 2021-12-25 22:30
 **/
public class LeetCode5946 {

    public int mostWordsFound(String[] sentences) {
        int maxCount = 0;
        int n = sentences.length;
        for (int i = 0; i < n; i++) {
            String[] split = sentences[i].split(" ");
            maxCount = Math.max(split.length, maxCount);
        }

        return maxCount;
    }

    public static void main(String[] args) {
        LeetCode5946 code = new LeetCode5946();
        System.out.println(code.mostWordsFound(new String[]{"alice and bob love leetcode", "i think so too", "this is great thanks very much"}));
    }

}
